package com.neoCalf.neoCommon.enums;

import lombok.Getter;
import lombok.ToString;


@Getter
@ToString
public enum FileTypeEnum {
    FILE(1, "文件", "file"),
    AVATAR(2, "头像", "avatar");
    private final Integer type;
    private final String description;
    private final String path;

    FileTypeEnum(Integer type, String description, String path) {
        this.type = type;
        this.description = description;
        this.path = path;
    }

    public static FileTypeEnum getFileTypeByType(Integer type) {
        if (type == null) {
            return null;
        }
        for (FileTypeEnum typeEnum : FileTypeEnum.values()) {
            if (typeEnum.getType().equals(type)) {
                return typeEnum;
            }
        }
        return null;
    }
}
